Visual Detection of Duplicated Code

نویسندگان

  • Matthias Rieger
  • Stéphane Ducasse
چکیده

Code duplication is considered as bad practice that complicates the maintenance and evolution of software. Detecting duplicated code is a difficult task because of the large amount of data to be checked and the fact that a priori it is unknown which code part has been duplicated. In this paper, we present a tool called DUPLOC that supports code duplication detection in a visual and exploratory or an automatic way. 1 Why we need to deal with Duplicated Code Duplicated code is a phenomenon that occurs frequently in large systems. Although duplication can have its justifications, it is considered bad practice. The reasons programmers duplicate code are multi-fold [Bak95] : making a copy of a code fragment is simpler and faster than writing the code from scratch and, in addition, the fragment may already be tested so the introduction of a bug seems less likely. Efficiency considerations may make the cost of a procedure call seem too high a price. In reverse engineering, we are interested in detecting and subsequently removing unjustified duplicated code for the following reasons: Removing bugs. If one is sure that the code segment where a bug is found occurs only once in the system, one can be confident that the bug has been eradicated from the system. This work has been funded by the Swiss Government under Project no. NFS-2000-46947.96 and BBW96.0015 as well as by the European Union under the ESPRIT program Project no. 21975.

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Evaluation of Duplicated Code Detection Tools in Cross-Project Context

Two or more code segments are considered duplicated when there is a high rate of similarity among them or they are exactly the same. Aiming to detect duplicated code in single software projects, several tools have been proposed. However, in case of cross-project detection, there are few tools. There is little empirical knowledge about the efficacy of these tools to detect duplicated code across...

متن کامل

Steganography Scheme Based on Reed-Muller Code with Improving Payload and Ability to Retrieval of Destroyed Data for Digital Images

In this paper, a new steganography scheme with high embedding payload and good visual quality is presented. Before embedding process, secret information is encoded as block using Reed-Muller error correction code. After data encoding and embedding into the low-order bits of host image, modulus function is used to increase visual quality of stego image. Since the proposed method is able to embed...

متن کامل

A Survey on Software Clone Detection Research

Code duplication or copying a code fragment and then reuse by pasting with or without any modifications is a well known code smell in software maintenance. Several studies show that about 5% to 20% of a software systems can contain duplicated code, which is basically the results of copying existing code fragments and using then by pasting with or without minor modifications. One of the major sh...

متن کامل

Automated Duplicated - Code Detection and Procedure Extraction

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . x

متن کامل

Generating Gapped Code Clone Information using Graph Mining Algorithm

At present, various kinds of code clone detection techniques have veen proposed. However, most of them cannot detect gapped code clones, which are ones that includes non-duplicated segments to its correspondant code clones. In this paper, we propose a method generating gapped code clone information from a detection result of existing code clone detection tools. The method adopts AGM (Apriori-ba...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 1998